package a_o2odata_deal.utils.zhibo_zf.zhengli

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.sql.SQLContext

/**
  * @ Auther: o2o-rd-0008
  * @ Date:   2020/2/11 10:59
  * @ Param:  ${PARAM}
  * @ Description: 
  */
object zhibo_zf_main {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
    conf.setAppName(s"${this.getClass.getSimpleName}")
    conf.set("spark.debug.maxToStringFields", "500")
    //conf.setMaster("local[*]")
    conf.set("es.nodes", "192.168.1.157")
    conf.set("es.port", "9200")
    conf.set("cluster.name", "O2OElastic")
    conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
    conf.set("spark.sql.caseSensitive", "true")
    val sc = new SparkContext(conf)
    val sqlContext = new SQLContext(sc)
    sc.setLogLevel("WARN")
    sc.hadoopConfiguration.set("fs.s3a.access.key", "GAO7EO9FWKPJ8WFCQDME")
    sc.hadoopConfiguration.set("fs.s3a.secret.key", "LZ0xaHBSYKHaJ9ECDbX9f7zin79UZkXfGoNapRPL")
    //sc.hadoopConfiguration.set("fs.s3a.endpoint", "https://obs.cn-north-1.myhuaweicloud.com")

    //创建商品库  dbadmin."o2o_showlive_APP_2020"
    a_o2odata_deal.utils.zhibo_zf.zhengli.handle_good.handle_good(sqlContext)
    //创建直播机构库  dbadmin."o2o_showlive_jigou"
    a_o2odata_deal.utils.zhibo_zf.zhengli.handle_zbjg.handle_zbjg(sqlContext)
    //创建是否是直播店铺库，主要是为了更新dbadmin."o2o_allPlat_shop_BDL_2020"
    a_o2odata_deal.utils.zhibo_zf.zhengli.handle_shop.handle_shop(sqlContext)
    //创建主播表  dbadmin."o2o_anchor_APP_2020"
    a_o2odata_deal.utils.zhibo_zf.zhengli.handle_zhubo.handle_zhubo(sqlContext)

  }
}
